package com.newtouch.rabbbitmq;

import com.newtouch.bean.NoticeInfo;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Date;
import java.util.logging.Logger;

/**
 * Created by Administrator on 2017/8/30.
 */
@Component
public class Sender {
    private final Logger log = Logger.getLogger("Sender.class");
    @Autowired
    private AmqpTemplate rabbitTemplate;

   /* public void send(NoticeInfo noticeInfo) {
        this.rabbitTemplate.convertAndSend("hello", noticeInfo);
    }*/

    public void send() {
        String sendMsg = "hello1 " + new Date();
        this.rabbitTemplate.convertAndSend("helloQueue", sendMsg);
        log.info("发送的参数是："+sendMsg);
    }
}
